
#include <windows.h>
#include "cards.h"

//
//	The interface to this module
//
extern BOOL InitCardsDll32(void);
extern int  DeInitCardsDll32(void);


//
//	Function prototypes for the card functions in cards.dll 
//	(32bit version)
//	
//	You must define these function pointers in your main app.
//
 pfcdtInit		cdtInit;
 pfcdtDraw		cdtDraw;
 pfcdtDrawEx		cdtDrawEx;
 pfcdtAnimate		cdtAnimate;
 pfcdtTerm		cdtTerm;

static HMODULE hCardDll;

BOOL InitCardsDll32(void)
{
	//this only works with NT
	if(GetVersion() >= 0x80000000)
		return FALSE;

	hCardDll = LoadLibrary("cards.dll");

	if(hCardDll == 0)
	{
		return FALSE;
	}
		
	//
	//	Set our main function pointers to point directly into cards.dll
	//
	cdtInit    = (pfcdtInit)    GetProcAddress(hCardDll, "cdtInit");
	cdtDraw    = (pfcdtDraw)    GetProcAddress(hCardDll, "cdtDraw");
	cdtDrawEx  = (pfcdtDrawEx)  GetProcAddress(hCardDll, "cdtDrawExt");
	cdtAnimate = (pfcdtAnimate) GetProcAddress(hCardDll, "cdtAnimate");
	cdtTerm    = (pfcdtTerm)    GetProcAddress(hCardDll, "cdtTerm");
	
	return TRUE;
}

BOOL DeInitCardsDll32(void)
{
	FreeLibrary(hCardDll);
	return TRUE;
}
